/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package DSB.GPS;

import DSB.Model.Kaart.Coordinaat;
import java.util.Observable;

/**
 *
 * @author Gebruiker
 */
public class GPSController extends Observable {
    private static GPSController gpsController;
    
    private Coordinaat _coordinaat = new Coordinaat(51.59409695453475, 4.77939629026413);
    
    private GPSController()
    {
    }
    
    /**
     *
     * @return
     */
    public static GPSController getInstance()
    {
        if(gpsController == null)
        {
            gpsController = new GPSController();
        }
        return gpsController;
    }
    
    public void ChangeCoordinates(double latitude, double longitude)
    {
        if(latitude > 0 && longitude > 0)
        {
            _coordinaat = new Coordinaat(latitude, longitude);
            setChanged();
            notifyObservers();
        }
    }
    
    public Coordinaat getCurrentCoordinates()
    {
        return _coordinaat;
    }
}
